A platform to programmatically author, schedule and monitor workflows
# install to default $AIRFLOW_HOME folder ~/airflow
pip install apache-airflow
# initialize the database
airflow initdb
# start the web server, default port is 8080
airflow webserver -p 8080
# start the scheduler
airflow scheduler
# visit localhost:8080 in the browser and enable the example dag in the home pageimport airflow
airflow.__version__
# '1.10.12'def print_context(ds, **kwargs):
pprint(kwargs)
print(ds)
return 'Whatever you return gets printed in the logs'
run_this = PythonOperator(
task_id='print_the_context',
provide_context=True,
python_callable=print_context,
dag=dag,
)t1 = BashOperator(task_id='print_date',
bash_command='date,
dag=dag)